package com.guiji.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.guiji.entity.TestCase;

import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: Jodie
 * @time: 2022/11/15
 */
public class TestCaseListener extends AnalysisEventListener<TestCase> {

    public List<TestCase> testCases = new ArrayList<>();

    // 读取每一行数据都会调用该方法
    @Override
    public void invoke(TestCase testCase, AnalysisContext analysisContext) {
        testCases.add(testCase);
    }

    // 读完一个sheet的数据会调用该方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("All data analysis complete....");
    }
}
